﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

public partial class _35newpart_Linq_LinQ_Select : System.Web.UI.Page
{
    Linq_SQLServeDataContext LinqDB = new Linq_SQLServeDataContext();
    protected void Page_Load(object sender, EventArgs e)
    {
        var M_Asks = LinqDB.M_Asks;
        var M_News = LinqDB.M_News;

        //执行LINQ to SQL
        var os = from pp in M_Asks
                 orderby pp.Id descending
                 where pp.Content.Length!=0
                 select new
                 {
                     编号 = pp.Id,
                     内容 = pp.Content,
                     作者 = pp.Author,
                     时间 = pp.LastBrowse
                 };

        GridView GridViewS = new GridView() { DataSource = os };
        GridViewS.DataBind();
        System.IO.StringWriter Sw = new System.IO.StringWriter();
        Html32TextWriter HT = new Html32TextWriter(Sw);
        GridViewS.RenderControl(HT);
        Response.Write(Sw.ToString());
        
    }

    //var 定义临时医名类
    void dd()
    {
        var data = new { strinx = "000", oooo = "000" ,o85=85,};

        //data.oooo;
    }

}

